- merge_request = local_assigns.fetch(:merge_request)
- self_approved = merge_request.approved_by?(current_user)
- total = merge_request.approvals.size

- if total > 0
  - final_text = n_("%d approver", "%d approvers", total) % total
  - final_self_text = n_("%d approver (you've approved)", "%d approvers (you've approved)", total) % total
  - approval_tooltip = self_approved ? final_self_text : final_text
  - approval_icon = self_approved ? 'approval-solid' : 'check'
  - badge_variant = :success
  - badge_label = _("Approved")

  %li.gl-flex{ class: '!gl-mr-0' }= render Pajamas::BadgeComponent.new(badge_label, variant: badge_variant, icon: approval_icon, title: approval_tooltip, class: 'has-tooltip', data: { 'testid': 'mr-approvals' })
